@import './config.scss';

%headline {
  color: #FFF;
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -1px;

  a { color: #FFF }
}

%headline__dark {
  color: #FFF;
  font-size: 20px;
  font-weight: 400;
  letter-spacing: -1px;

  a { color: #FFF }
}

.theme__dark {
  .settings-wrapper { background: rgba($dark-theme-black, .8); }

  .settings {
    .settings__header {
      .mdi { color: #FFF }
    }

    .settings__main {
      background: $dark-theme-gray-darkest;
    }

    .settings__body::-webkit-scrollbar-thumb { background: $dark-theme-gray; }

    .settings__close {
      color: #FFF;
    }

    &__settings-group h3 { color: $dark-theme-gray-lightest; }

    .settings__message {
      border-top: 1px solid $theme-gray-lighter;
      color: $dark-theme-gray-lightest;

      .mdi { color: $dark-theme-gray-lightest; }
    }

    .settings__help { color: $dark-theme-gray-lightest; }

    .settings__controls {
      background: $dark-theme-gray-darker;

      .franz-form__button.franz-form__button--secondary { background: $theme-gray-light; }
    }

    .account {
      .account__box { background: $dark-theme-gray-darker; }
    }

    .premium-info {
      background: $dark-theme-gray-darker;
      border: 2px solid $theme-brand-primary;
    }
    .legal { color: $theme-gray-light; }
  }

  .settings-navigation {
    background: $dark-theme-gray-darker;
    border-right: 1px solid $dark-theme-gray-dark;

    .settings-navigation__link {
      color: $dark-theme-gray-lightest;
      border-bottom: 1px solid darken($dark-theme-gray-darker, 3%);

      &:last-child {
        border: 0,
      }

      .badge {
        background: $dark-theme-gray-lighter;
        color: $dark-theme-gray-smoke;
      }

      &:hover {
        background: darken($dark-theme-gray-darker, 5%);

        .badge {
          background: $dark-theme-gray-lighter;
          color: $dark-theme-gray-smoke;
        }
      }

      &.is-active {
        background: $dark-theme-gray;
        color: $dark-theme-gray-smoke;

        .badge {
          background: $dark-theme-gray-lighter;
          color: $dark-theme-gray-smoke;
        }
      }
    }

    .settings-navigation__action-badge { background: $theme-brand-danger; }
  }
}

.settings-wrapper {
  align-items: center;
  background: rgba(black, .5);
  display: flex;
  height: 100%;
  left: 0;
  justify-content: center;
  padding: 25px;
  position: absolute;
  top: 0;
  width: 100%;
  z-index: 9998;

  .settings-wrapper__action {
    height: 100%;
    left: 0;
    position: absolute;
    top: 0;
    width: 100%;
  }
}

.settings {
  border-radius: $theme-border-radius;
  // box-shadow: 0 20px 50px rgba(black, .5);
  display: flex;
  height: 100%;
  max-height: 800px;
  max-width: 1140px;
  min-height: 400px;
  // overflow: hidden;
  position: relative;
  width: 100%;
  z-index: 9999;

  .settings__main {
    display: flex;
    flex: 1;
    flex-direction: column;
    height: auto;
    border-radius: $theme-border-radius;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba($dark-theme-black, .5);
    background: #FFF;
  }

  .settings__header {
    align-items: center;
    background: $theme-brand-primary;
    display: flex;
    height: 50px;
    padding: 0 40px;
    width: calc(100% - 60px);
    color: #FFF;

    h1 {
      @extend %headline;
      margin: 0;
    }

    .settings__header-item {
      @extend %headline;
    }

    .separator {
      border-right: 1px solid darken($theme-brand-primary, 8%);
      height: 100%;
      margin: 0 15px;
      transform: skew(15deg) rotate(2deg);
    }

    .mdi { color: $theme-gray-light; }
  }

  .settings__body {
    flex: 1;
    margin: 15px;
    overflow-y: scroll;
    padding: 25px 15px 15px 25px;

    &::-webkit-scrollbar { width: 8px; }

    /* Track */
    &::-webkit-scrollbar-track {
      background: none;
      border-radius: 10px;
      -webkit-border-radius: 10px;
    }

    /* Handle */
    &::-webkit-scrollbar-thumb {
      background: $theme-gray-lighter;
      border-radius: 10px;
      -webkit-border-radius: 10px;
    }

    &::-webkit-scrollbar-thumb:window-inactive { background: none; }
    .service-flex-grid { display: flex; }
    .service-name { flex: 1px; }

    .service-icon {
      float: right;
      margin-left: 40px;
      margin-top: 30px;
      width: 140px;

      label {
        font-weight: bold;
        letter-spacing: -0.1px;
      }
    }

    .proxyHost {
      flex-basis: 70%;
    }
  }

  .settings__close {
    background: $theme-brand-primary;
    border-left: 1px solid darken($theme-brand-primary, 8%);
    color: #FFF;
    font-size: 20px;
    height: 50px;
    padding: 0 20px;
    position: absolute;
    right: 0;
    transition: background $theme-transition-time;
    border-top-right-radius: $theme-border-radius;

    &:hover { background: darken($theme-brand-primary, 5%); }
  }

  .search-input { margin-bottom: 30px; }

  &__options {
    flex: 1;
    margin-top: 20px;
  }

  &__settings-group {
    margin-top: 10px;

    h3 {
      color: $theme-gray-light;
      font-weight: bold;
      letter-spacing: -.1px;
      margin: 25px 0 15px;

      &:first-of-type { margin-top: 0; }

      .badge {
        font-weight: normal;
        margin-left: 10px;
      }
    }
  }

  .settings__message {
    border-top: 1px solid $theme-gray-lighter;
    color: $theme-gray-light;
    display: flex;
    margin-top: 40px;
    padding-top: 15px;

    .mdi {
      color: $theme-gray-light;
      font-size: 20px;
      margin-right: 10px;
    }
  }

  .settings__help {
    color: $theme-gray-light;
    font-size: 12px;
    margin: -10px 0 20px 55px;;
  }

  .settings__controls {
    background: $theme-gray-lighter;
    display: flex;
    height: auto;
    justify-content: space-between;
    padding: 10px 20px;

    .franz-form__button {
      &[type='submit'] { margin-left: auto; }
      &.franz-form__button--secondary { background: $theme-gray-light; }
    }
  }

  .settings__delete-button { right: 0; }

  .settings__empty-state {
    align-items: center;
    align-self: center;
    height: auto;
    min-height: 70%;
    text-align: center;
    width: 100%;

    a.button { margin-top: 40px; }
  }

  .account {
    height: auto;

    .account__box {
      align-items: center;
      background: $theme-gray-lightest;
      border-radius: $theme-border-radius;
      margin-bottom: 40px;
      padding: 20px;

      &.account__box--flex { display: flex; }
      &.account__box--last { margin-bottom: 0; }

      .auth__button {
        margin-top: 10px;
        width: 100%;
      }
    }

    .account__avatar {
      margin-right: 20px;
      position: relative;
    }

    .account__info {
      flex: 1;

      h2 { margin-bottom: 5px; }
      .badge { margin-top: 5px; }
      .username { margin-right: 10 }
    }

    .account__subscription {
      align-items: center;
      display: flex;

      .badge { margin-left: 10px; }
    }

    .badge--premium {
      margin-left: 1px;
      position: relative;
      top: -3px;
      padding-top: 4px;
      color: #FFF;
      border-radius: 3px;
    }


    .manage-user-links {
      margin-top: 20px;
      display: flex;
      justify-content: space-between;
    }

    .account__subscription-button { margin-left: auto; }
    .franz-form__button { white-space: nowrap; }
    div { height: auto; }
    [data-type="franz-button"] div { height: 20px }

    .invoices {
      width: 100%;

      td {
        border-bottom: 1px solid $theme-gray-lighter;
        padding: 15px 0;
      }

      tr:last-of-type td {
        border: 0;
        padding-bottom: 0;
      }

      .invoices__action {
        text-align: right;

        button { color: $theme-brand-primary; }
      }
    }
  }

  .emoji {
    display: block;
    font-size: 40px;
    margin-bottom: 20px;

    img { width: 40px; }
  }

  .premium-info {
    background: lighten($theme-brand-primary, 40%);
    border-radius: $theme-border-radius;
    padding: 20px;
  }

  .content-tabs .premium-info {
    background: none;
    padding: 0;
  }

  .legal {
    color: $theme-gray-light;
    margin-top: 20px;
    text-align: center;
  }
}

.settings-navigation {
  display: flex;
  background: $theme-gray-lightest;
  flex-direction: column;
  height: auto;
  width: 240px;
  height: calc(100% - 100px);
  align-self: center;
  border-top-left-radius: $theme-border-radius;;
  border-bottom-left-radius: $theme-border-radius;;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba($dark-theme-black, .5);

  .settings-navigation__link {
    align-items: center;
    justify-content: space-between;
    color: $theme-text-color;
    display: flex;
    flex-shrink: 0;
    height: 50px;
    padding: 0 20px;
    text-decoration: none;
    transition: background $theme-transition-time, color $theme-transition-time;
    border-bottom: 1px solid darken($theme-gray-lightest, 3%);

    &:hover {
      background: darken($theme-gray-lightest, 5%);

      .badge {
        background: #FFF;
      }
    }

    &.is-active {
      background: $theme-brand-primary;
      color: #FFF;

      .badge {
        background: #FFF;
        color: $theme-brand-primary;
      }
    }
  }

  .settings-navigation__expander { flex: 1; }

  .badge {

    display: initial;
    transition: background $theme-transition-time, color $theme-transition-time;
  }

  .settings-navigation__action-badge {
    background: $theme-brand-danger;
    border-radius: 100%;
    display: inline-block;
    height: 7px;
    margin-left: 5px;
    width: 7px;
  }
}
